From: Florian Müllner Date: Mon, 25 Jan 2021 11:38:51 +0000 (+0100) Subject: screenshot: Use separate error when disk writes are locked down X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~556 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1aee0516d67060c3fa6d68b72ebab0f1c84233ef;p=gnome-shell.git screenshot: Use separate error when disk writes are locked down The most likely reason for rejecting a screenshot request is that there's an ongoing operation from the same sender. Still, we shouldn't assume that that is the case and return an appropriate error when writing to disk is disabled via lockdown settings. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3618 Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 787e60f9a..29cf7c897 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -36,11 +36,16 @@ var ScreenshotService = class { lockedDown = this._lockdownSettings.get_boolean('disable-save-to-disk'); let sender = invocation.get_sender(); - if (this._screenShooter.has(sender) || lockedDown) { + if (this._screenShooter.has(sender)) { invocation.return_error_literal( Gio.IOErrorEnum, Gio.IOErrorEnum.BUSY, 'There is an ongoing operation for this sender'); return null; + } else if (lockedDown) { + invocation.return_error_literal( + Gio.IOErrorEnum, Gio.IOErrorEnum.PERMISSION_DENIED, + 'Saving to disk is disabled'); + return null; } let shooter = new Shell.Screenshot();